<!--
* description: 线索管理
* author: mwh
* createdDate: 2020-11-21
-->
<template>
  <div class="app-container app-container-table" style="margin-top: 0px">
    <el-tabs v-model="activeName" @tab-click="tabClick">
      <el-tab-pane label="今日待分配线索" name="crmThisGWACCDistrpage">
        <crmThisGWACCDistrpage ref="crmThisGWACCDistrpage"  />
      </el-tab-pane>
      <el-tab-pane label="今日线索跟进" name="cluesAssignedToday">
        <cluesAssignedToday ref="cluesAssignedToday"  />
      </el-tab-pane>
      <el-tab-pane label="战败审核" name="defeatClueReview">
        <defeatClueReview ref="defeatClueReview"  />
      </el-tab-pane>
      <el-tab-pane label="超时未跟进线索" name="timeOutClue">
        <timeOutClue ref="timeOutClue" />
      </el-tab-pane>
      <!-- <el-tab-pane label="线索详情" name="cs">
        <cs ref="cs" />
      </el-tab-pane> -->
    </el-tabs>
  </div>
</template>
<script>
export default {
  name: "cluesManagement",
  // 组件混入对象
  components: {
    crmThisGWACCDistrpage: () => import("./crmThisGWACCDistrpage"),// 今日待分配线索
    cluesAssignedToday: () => import("./cluesAssignedToday"),// 今日线索跟进
    defeatClueReview: () => import("./DefeatClueReview"),// 战败审核
    timeOutClue: () => import("./timeOutClue"),// 超时未跟进线索
    // cs: () => import("./cs"),// 超时未跟进线索
  },
  data() {
    return {
      activeName: "crmThisGWACCDistrpage"
    };
  },
  mounted(){
    let that=this
    // 缩放适应事件
    this.$nextTick(()=>{
      window.addEventListener('resize', () => {
      if( that.$refs.crmThisGWACCDistrpage){
       that.$refs.crmThisGWACCDistrpage.$refs.multipleTable.setTableHeight();
      }
      if(that.$refs.cluesAssignedToday){
       that.$refs.cluesAssignedToday.$refs.multipleTable.setTableHeight();
      }
      if(that.$refs.defeatClueReview){
       that.$refs.defeatClueReview.$refs.multipleTable.setTableHeight();
      }
      if(that.$refs.timeOutClue){
       that.$refs.timeOutClue.$refs.multipleTable.setTableHeight();
      }
    })
    })
  },
  methods: {
    // apply() {
    //   this.activeName = "crmThisGWACCDistrpage";
    // },
    // return1() {
    //   this.activeName = "carConfig";
    // },
    // tab栏点击 网格自适应
    tabClick(tab) {
      // if (this.$refs.multipleTable) {
      //   this.$refs.multipleTable.setTableHeight();
      // }
      if(this.$refs[tab.name].$refs.multipleTable){
        this.$refs[tab.name].$refs.multipleTable.setTableHeight(true);
      }
    }
  }
};
</script>
<style lang="scss" scoped>
/deep/ .el-tabs__nav-scroll {
  overflow: hidden;
  background-color: #ffffff;
  padding-left: 20px;
}
/deep/ .app-container {
  margin-top: 0px;
  background: #fff;
  padding: 10px 10px 0 10px;
}
/deep/ .el-tabs__header {
  margin-bottom: 0px;
  padding: 0px;
}
</style>